package com.basketball.gym.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.basketball.gym.pojo.Price;
import com.basketball.gym.mapper.PriceMapper;
import com.basketball.gym.pojo.ResponseData;
import com.basketball.gym.pojo.state.ResponseState;
import com.basketball.gym.service.PriceService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author 赵肖云
 * @since 2021-03-27
 */
@Service
public class PriceServiceImpl extends ServiceImpl<PriceMapper, Price> implements PriceService {
    @Autowired
    private PriceMapper priceMapper;
    /**
     * 查询价格
     */
    @Override
    public ResponseData<List<Price>> getPrice() {
        List<Price> prices=priceMapper.selectList(new QueryWrapper<>());
        return new ResponseData<>(ResponseState.SUCCESS.getMessage(), ResponseState.SUCCESS.getValue(),prices);
    }
}
